package eraserhead.xml.request;

import xml.Message;
import client.ServerAccess;

/**
 * Class for sending an AddChoice request.
 * @author Michael Checca
 */
public class AddChoiceRequest {
	/**
	 * Sends a AddChoiceRequest to the server.
	 * @param sa {@link ServerAccess} to send request the {@link Message to}
	 * @param id Event id
	 * @param choice Choice to send
	 * @param number Number of the choice to send
	 */
	public static void send(ServerAccess sa, String id, String choice, int number) {
		String xmlMessage = String.format(
				"%s<addChoiceRequest id=\"%s\" choice=\"%s\" number=\"%d\"/></request>",
				Message.requestHeader(), id, choice, number);
		sa.sendRequest(new Message(xmlMessage));
	}
}
